<?php


namespace app\common\model\tang;

use app\common\impl\Comm;
use app\common\model\CommonBaseModel;
use app\common\model\tang\Merchant;
use think\Facade\Db;

class Polling extends CommonBaseModel implements Comm
{

    public function getAdminPageData($param = [], $order = 'id desc',$where=[])
    {
        $model = self::where($where);
        $data = $model->with(['merchant'])->order($order)->where($where)->page(PAGE)->limit(LIMIT)->select()->toArray();
        $count = count($data);
        return parent::ajaxResult($data,$count);

    }
    public function merchant(): \think\model\relation\HasOne
    {
        return $this->hasOne(Merchant::class,'id','merchant_id');
    }
    public function delById($id)
    {
        // TODO: Implement delById() method.
    }

    public function doAll($data)
    {
        // TODO: Implement doAll() method.
        return parent::doAllData($data);
    }
}